package com.spzx.cart.api.fallback;

import com.spzx.cart.api.RemoteUpdateCartPrice;
import com.spzx.common.core.domain.R;
import org.springframework.cloud.openfeign.FallbackFactory;

/**
 * ClassName: RemoteUpdateCartPrice
 * Description:
 *
 * @Author linz
 * @Creat 2025/3/21 15:24
 * @Version 1.00
 */
public class RemoteUpdateCartPriceFallbackFactory implements FallbackFactory<RemoteUpdateCartPrice> {


    @Override
    public RemoteUpdateCartPrice create(Throwable cause) {
        return new RemoteUpdateCartPrice() {
            @Override
            public R<Boolean> updateCartPrice(String source) {
                cause.printStackTrace();
                return R.fail("更新购物车价格失败->"+cause.getMessage());
            }
        };
    }
}
